Skip to content

fix(server): run each SQLite setup PRAGMA on its own - #34

Open
neur0map wants to merge 1 commit into
MiaAI-Lab:mainfrom
neur0map:fix/sqlite-setup-pragmas
Open

neur0map wants to merge 1 commit into
MiaAI-Lab:mainfrom
neur0map:fix/sqlite-setup-pragmas

Conversation

@neur0map

Copy link
Copy Markdown

Hey, I picked up some of your perf work for my own T3 fork and noticed the SQLite setup doesn't fully apply.

The PRAGMAs in Sqlite.ts are joined into one string, but SQLite only runs the first statement of a prepared query and quietly ignores the rest. So right now only journal_mode (and busy_timeout in the other pair) actually take effect. synchronous stays on FULL, the 64 MiB cache and mmap never kick in, and the WAL size limit isn't set.

This puts each PRAGMA back on its own line and adds a small test that reads them back. The test fails on main and passes with the fix.

Thanks for the fork, the telemetry cleanup was really useful to see.

The setup PRAGMAs were joined into one string, but a prepared statement
only runs the first statement in it. Only journal_mode and busy_timeout
were applied; synchronous stayed FULL, the page cache and mmap stayed at
their defaults and the WAL size limit was never set.

Back to one call per PRAGMA, with a test that reads them back.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S labels Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant